<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
/**
 * 总后台路由
 */

Route::group(['namespace' => 'Admin','domain' => 'admin.'.env('APP_DOMAIN')], function(){
	Route::any('/','IndexController@index');

	//用户管理
	Route::group(['prefix'=>'ucenter'],function(){
		$controller = 'UcenterController@';
		Route::any('ucenter_list',$controller.'ucenter_list');
		Route::any('ucenter_vip_cost',$controller.'ucenter_vip_cost');
		Route::any('ucenter_pur_cost',$controller.'ucenter_pur_cost');
		Route::get('ucenter_direct_cost',$controller.'ucenter_direct_cost');
		Route::any('ucenter_online_order',$controller.'ucenter_online_order');
		Route::get('ucenter_details',$controller.'ucenter_details');
		Route::get('ucenter_purse',$controller.'ucenter_purse');
		Route::any('user_tree',$controller.'user_tree');
		Route::any('user_transfer',$controller.'user_transfer');
        Route::any('ajax_user_transfer',$controller.'ajax_user_transfer');
        Route::post('post_get_ticket',$controller.'post_get_ticket');
        Route::any('user_register',$controller.'user_register');

		Route::any('team_recharge',$controller.'team_recharge');
		Route::get('get_user_introducer',$controller.'get_user_introducer');
		Route::get('team_recharge_list',$controller.'team_recharge_list');
		Route::get('team_recharge_detail',$controller.'team_recharge_detail');

		Route::any('modify_user_to_vip',$controller.'modify_user_to_vip');
        Route::any('recharge_integral',$controller.'recharge_integral');
	});

	//订单管理
	Route::group(['prefix'=>'order'],function(){
		$controller = 'OrderController@';
		Route::any('purchas_list',$controller.'purchas_list');
		Route::get('order_detail',$controller.'order_detail');
		Route::any('order_list',$controller.'order_list');
	});

	//商品管理
	Route::group(['prefix'=>'product'],function(){
		$controller = 'ProductController@';
		Route::any('product_recovery',$controller.'product_recovery');
		Route::get('order_list',$controller.'order_list');
	});

	//评论管理
	Route::group(['prefix'=>'comment'],function(){
		$controller = 'CommentController@';
		Route::any('List',$controller.'List');
		Route::any('Del',$controller.'Del');
	});
	//二维码管理
	Route::group(['prefix'=>'qrcode'],function(){
		$controller = 'QrcodeController@';
		Route::any('List',$controller.'List');
		Route::any('download',$controller.'download');
	});

	//财务管理
	Route::group(['prefix'=>'fund'],function(){
		$controller = 'FundController@';
		Route::any('kjpay_withdrawal',$controller.'kjpay_withdrawal');
	});

	//首页
	Route::group(['prefix'=>'index'],function(){
		$controller = 'IndexController@';
		Route::get('index',$controller.'index');
		Route::get('main',$controller.'main');
		Route::get('user',$controller.'user');
		Route::post('upload_image',$controller.'upload_image');		// js upload_one_image() 公共图片上传方法使用
		Route::post('upload',$controller.'upload');		//webuploader上传
	});

	//用户行为日志记录
	Route::group(['prefix'=>'system'],function(){
		$controller = 'SystemController@';
		Route::any('admin_action_list',$controller.'admin_action_list');
		Route::get('admin_action_detail',$controller.'admin_action_detail');
		Route::any('apply_list',$controller.'apply_list');
		Route::get('apply_action',$controller.'apply_action');
		Route::post('apply_save',$controller.'apply_save');
		Route::any('apply_edit',$controller.'apply_edit');
	});

	//分红管理
	Route::group(['prefix'=>'dividend'],function(){
		$controller = 'DividendController@';
		Route::any('bind_relation',$controller.'bind_relation');
		Route::any('dividend',$controller.'dividend');
		Route::any('dividend_list',$controller.'dividend_list');
		Route::any('get_product',$controller.'get_product');
		Route::any('get_node',$controller.'get_node');
		Route::any('send_sms',$controller.'send_sms');
	});

	//权限管理
	Route::group(['prefix'=>'rbac'],function(){
		$controller = 'RbacController@';
		Route::get('rbac_list',$controller.'rbac_list');
	});

	//基础配置
	Route::group(['prefix'=>'basiconfig'],function(){
		$controller = 'BasiconfigController@';
		Route::any('transfer_rule',$controller.'transfer_rule');
		Route::any('add_rule',$controller.'add_rule');
		Route::any('del',$controller.'del');
		Route::any('transfer_reason',$controller.'transfer_reason');
		Route::any('add_reason',$controller.'add_reason');
		Route::any('delreason',$controller.'delreason');


	});


	//货币管理
	Route::group(['prefix'=>'currency'],function(){
		$controller = 'CurrencyController@';
		Route::any('currency',$controller.'currency');
		Route::any('add_currency',$controller.'add_currency');
		Route::any('del',$controller.'del');
		Route::any('transfer_reason',$controller.'transfer_reason');
		Route::any('add_reason',$controller.'add_reason');
		Route::any('delreason',$controller.'delreason');


	});

	//钱包账户管理
	Route::group(['prefix'=>'wallet'],function(){
		$controller = 'WalletController@';
		Route::any('wallet_list',$controller.'wallet_list');
		Route::any('add_wallet',$controller.'add_wallet');
		Route::any('del',$controller.'del');
		Route::any('transfer_reason',$controller.'transfer_reason');
		Route::any('block_money',$controller.'block_money');
		Route::any('change_history',$controller.'change_history');
		Route::any('flow_statistics',$controller.'flow_statistics');
		Route::any('lock_unlock',$controller.'lock_unlock');
		Route::any('statechange',$controller.'statechange');
		Route::any('fundfreeze',$controller.'fundfreeze');
		Route::any('unfreeze_funds',$controller.'unfreeze_funds');

	});

	//资金管理
	Route::group(['prefix'=>'capital'],function(){
		$controller = 'CapitalController@';
		Route::any('capital_flow',$controller.'capital_flow');
		Route::any('add_wallet',$controller.'add_wallet');
		Route::any('del',$controller.'del');
		Route::any('transfer_reason',$controller.'transfer_reason');
		Route::any('block_money',$controller.'block_money');
		Route::any('change_history',$controller.'change_history');
		Route::any('flow_statistics',$controller.'flow_statistics');
		Route::any('lock_unlock',$controller.'lock_unlock');
		Route::any('statechange',$controller.'statechange');
		Route::any('fundfreeze',$controller.'fundfreeze');
		Route::any('unfreeze_funds',$controller.'unfreeze_funds');
		Route::any('account_transfer',$controller.'account_transfer');
		Route::any('choise_outmoney',$controller.'choise_outmoney');
		Route::any('intoaccount_transfer',$controller.'intoaccount_transfer');
		Route::any('water_off',$controller.'water_off');
		Route::any('water_log',$controller.'water_log');
		Route::any('cover_water',$controller.'cover_water');
		Route::any('transfer_log',$controller.'transfer_log');
		Route::any('transfer_log_detail',$controller.'transfer_log_detail');
		Route::any('common_method',$controller.'common_method');
		Route::any('doTransfer',$controller.'doTransfer');
		

		
		


	});
	//登录
	Route::group(['prefix'=>'user'],function(){
		$controller = 'UserController@';
		Route::any('login',$controller.'login');
		Route::get('logout',$controller.'logout');
	});

	//用户管理
	// Route::group(['prefix'=>'ucenter'],function(){
	// 	$controller = 'UcenterController@';
	// 	Route::get('ucenter_list',$controller.'ucenter_list');
	// 	Route::post('ucenter_list',$controller.'ucenter_list');
	// 	Route::get('ucenter_vip_cost',$controller.'ucenter_vip_cost');
	// 	Route::get('ucenter_direct_cost',$controller.'ucenter_direct_cost');
	// 	Route::get('ucenter_online_order',$controller.'ucenter_online_order');
	// 	Route::get('ucenter_details',$controller.'ucenter_details');
	// 	Route::get('ucenter_purse',$controller.'ucenter_purse');
	// 	Route::get('user_tree',$controller.'user_tree');

	// });

	//手机型号编辑 + 免费领手机区域代理
	Route::group(['prefix'=>'mobile'],function(){
		$controller = 'MobileController@';
		Route::any('index',$controller.'index');
		Route::any('add',$controller.'add');
		Route::any('upload',$controller.'upload');
		Route::any('edit',$controller.'edit');
		Route::any('del',$controller.'del');
		Route::any('agent',$controller.'agent');
		Route::any('agent_edit',$controller.'agent_edit');
		Route::any('category',$controller.'category');
		Route::any('category_add',$controller.'category_add');
		Route::any('category_edit',$controller.'category_edit');
	});


	// 全球汇路由部分
    Route::group(['prefix'=>'globalexchange'],function(){
    	$controller = 'GlobalExchangeController@';
    	$name_pre = 'admin.globalexchange.';
    	// 直销套餐
		Route::get('direct',$controller.'direct');
		Route::get('direct_add',$controller.'direct_add');
		Route::post('direct_add_submit',$controller.'direct_add_submit');
		Route::post('direct_del',$controller.'direct_del');
		// 直销套餐子商品
		Route::get('direct_item',$controller.'direct_item');
		Route::get('direct_item_add',$controller.'direct_item_add');
		Route::post('direct_item_add_submit',$controller.'direct_item_add_submit');
		Route::post('direct_item_del',$controller.'direct_item_del');
		//直销订单
		Route::get('direct_order', $controller.'direct_order');
		Route::get('direct_order_detail', $controller.'direct_order_detail');
		Route::post('direct_order_edit', $controller.'direct_order_edit');
    	
    	// 系统套餐
    	Route::get('direct_group',$controller.'direct_group');
    	Route::get('direct_group_add',$controller.'direct_group_add')->name($name_pre.'direct_group_add');
    	Route::post('direct_product_search',$controller.'direct_product_search')->name($name_pre.'direct_product_search');
    	Route::post('direct_group_add_submit',$controller.'direct_group_add_submit')->name($name_pre.'direct_group_add_submit');
    	Route::post('direct_group_del',$controller.'direct_group_del')->name($name_pre.'direct_group_del');
	});

    //banner图管理
    Route::group(['prefix' => 'banner'], function(){
		$controller = 'BannerController@';
		Route::any('list',$controller.'index');
		Route::any('add',$controller.'add');
		Route::any('del',$controller.'del');
    });

	//banner图管理
    Route::group(['prefix' => 'merchant'], function(){
		$controller = 'MerchantController@';
		Route::any('edit',$controller.'edit');
		Route::any('orderList',$controller.'orderList');
		Route::any('orderDel',$controller.'orderDel');
    });

});


/**
 * 代理后台路由
 */

Route::group(['namespace' => 'Agent','domain' => 'mobile.agent.'.env('APP_DOMAIN')], function() {

	Route::any('/',['uses'  => 'LoginController@login', 'as' => 'agentLogin']);

    Route::group(['prefix'=>'Agent'],function(){
		$aic_controller='IndexController@';
		$alc_controller='LoginController@';
		#首页
		Route::any('index',['uses'  => $aic_controller.'index', 'as' => 'index']);
		#登录页面
		Route::any('login',['uses'  => $alc_controller.'login','as' => 'login']);
		#退出
		Route::any('loginout',['uses'  => $alc_controller.'loginOut', 'as' => 'loginout']);
	});

	#用户任务列表
	Route::group(['prefix'=>'Apply'],function(){
		$controller='ApplyController@';
		#查看用户领取任务列表
		Route::any('list',['uses'  => $controller.'applyList', 'as' => 'applylist']);
		#改变用户领取任务状态
		Route::any('change',['uses'  => $controller.'changeStatus','as' => 'changestatus']);
		#用户领取任务申请详情查看及编辑
		Route::any('detail',['uses'  => $controller.'applyDetail',]);
		#用户直销套餐详情
		Route::any('order/detail',['uses'  => $controller.'vipOrderDetail',]);
		#用户申请进度
		Route::any('schedule/detail',['uses'  => $controller.'scheduleDetail',]);
		#用户任务完成明细
		Route::any('task/detail',['uses'  => $controller.'taskDetail',]);
		#删除用户领取申请
		Route::any('delete',['uses'  => $controller.'applyDel',]);
	});

});

Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');



